import 'dart:collection';

class IndexPageBaseInfoModel {
  List<Features>? features;
  List<Carousels>? carousels;
  int? waitReadMessageNum;

  IndexPageBaseInfoModel(
      {this.features, this.carousels, this.waitReadMessageNum});

  IndexPageBaseInfoModel.fromJson(Map<String, dynamic> json) {
    if (json['features'] != null) {
      features = <Features>[];
      json['features'].forEach((v) {
        if (v != null) {
          features!.add(Features.fromJson(v));
        }
      });
    }
    if (json['carousels'] != null) {
      carousels = <Carousels>[];
      json['carousels'].forEach((v) {
        if (v != null) {
          carousels!.add( Carousels.fromJson(v));
        }
      });
    }
    waitReadMessageNum = json['waitReadMessageNum'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = HashMap();
    if (features != null) {
      data['features'] = features!.map((v) => v.toJson()).toList();
    }
    if (carousels != null) {
      data['carousels'] = carousels!.map((v) => v.toJson()).toList();
    }
    data['waitReadMessageNum'] = waitReadMessageNum;
    return data;
  }
}

class Features {
  String? iconUrl;
  String? featuresName;
  String? redirectUrl;
  String? jumpType;
  String? shareDetail;
  int? sequence;
  bool? isShow;

  Features(
      {this.iconUrl,
      this.featuresName,
      this.redirectUrl,
      this.jumpType,
      this.shareDetail,
      this.sequence,
      this.isShow});

  Features.fromJson(Map<String, dynamic> json) {
    iconUrl = json['iconUrl'];
    featuresName = json['featuresName'];
    redirectUrl = json['redirectUrl'];
    jumpType = json['jumpType'];
    shareDetail = json['shareDetail'];
    sequence = json['sequence'];
    isShow = json['isShow'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = HashMap();
    data['iconUrl'] = iconUrl;
    data['featuresName'] = featuresName;
    data['redirectUrl'] = redirectUrl;
    data['jumpType'] = jumpType;
    data['shareDetail'] = shareDetail;
    data['sequence'] = sequence;
    data['isShow'] = isShow;
    return data;
  }
}

class Carousels {
  String? showImg;
  String? redirectUrl;
  String? redirectType;
  int? sequence;

  Carousels({this.showImg, this.redirectUrl, this.redirectType, this.sequence});

  Carousels.fromJson(Map<String, dynamic> json) {
    showImg = json['showImg'];
    redirectUrl = json['redirectUrl'];
    redirectType = json['redirectType'];
    sequence = json['sequence'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = HashMap();
    data['showImg'] = showImg;
    data['redirectUrl'] = redirectUrl;
    data['redirectType'] = redirectType;
    data['sequence'] = sequence;
    return data;
  }
}